<?php

namespace app\admin\model;

use app\common\model\TimeModel;

class DataUserLotteryNum extends TimeModel
{

    protected $name = "data_user_lottery_num";

    protected $table = "";

    protected $deleteTime = "delete_time";


    public static function onAfterWrite($model){

        if(!empty($model->unid)){
            $user =  new DataUser();
            $user = $user->find(['id'=>$model->unid]);
            $user->num++;
            $user->save();
        }

    }

}